// 确保唯一实例，避免重复创建
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'; // 持久化插件
const pinia = createPinia().use(piniaPluginPersistedstate) // 使用插件;

export default pinia

import { useUserStore } from './modules/user'
import { useConfigStore } from './modules/config'

export const useStore = () => {
    return {
        userStore: useUserStore(pinia),
        useConfig: useConfigStore(pinia)
    }
}

